public class Main {
    public static void main(String[] args) {
        Ticket ticket1 = new Ticket();
        Ticket ticket2 = new Ticket();
        Ticket ticket3 = new Ticket();
        double originalPrice = 60.0;
        //初始化
        ticket1.setPrice(originalPrice);
        ticket2.setPrice(originalPrice);
        ticket3.setPrice(originalPrice);
        System.out.println("原始价为：" + originalPrice);
        //注入
        IDiscount discount1=new DiscountChildren();
        IDiscount discount2=new DiscountVIP();
        IDiscount discount3=new DiscountStudent();
        ticket1.setDiscount(discount1);
        ticket2.setDiscount(discount2);
        ticket3.setDiscount(discount3);

        System.out.println("折后价为：" );
        System.out.println(ticket1.getPrice());
        System.out.println(ticket2.getPrice());
        System.out.println(ticket3.getPrice());

    }
}